home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0028_SETMODE4.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  2KB  |  37 lines

  1. There are basically three ways you can do it, all of them using
  2. Interrupt 10h (video interrupt). First, set up something in your Var
  3. like this:
  4.  
  5.   Var
  6.     Regs : Registers;
  7.  
  8. Function 0 sets the mode, which will also clear the screen.  This is
  9. useful if you want to set mode and clear screen at the same time.
  10. It would look like this;
  11.  
  12.   REGS.AH := 0;
  13.   REGS.AL := x; { where x is the mode you want (get a good Dos
  14.                   reference manual For these) }
  15.   inTR($10,REGS);
  16.  
  17. The other two options are Really inverses of each other...scroll
  18. Window up and scroll Window down.  The advantage of these is that it
  19. doesn't clear the border color (set mode does).  The disadvantage is
  20. there are a lot more parameters to set.  For these, AH = 6 For scroll up
  21. and 7 For scroll down.  AL = 0 (this Forces a clear screen), CH = the
  22. upper row, CL = the left column, DH = the lower row, DL = the right
  23. column, and BH = the color attribute (Foreground and background).  As I
  24. said, it's a bit more Complicated, but you can set the screen color at
  25. the same time if you want to (if not, you'll need to get the current
  26. attribute first and store it in BH).  You'll also have to know the
  27. current screen mode (40 or 80 columns, 25, 35, 43, or 50 lines).
  28.  
  29. As you can see, clearing the screen without using Crt is a bit more
  30. Complicated, but you can set a lot of options at the same time as well.
  31. It's up to you.
  32.  
  33. Just as an after-note, I'm currently working on a way to use
  34. page-switching in Crt mode, writing directly to the video memory.  I'm
  35. sick of not being to switch pages without loading Graph (waste of space
  36. and memory, just to switch pages).
  37.